package gptma.bo.model.task;

import gptma.bo.model.BaseEntity;

import java.util.Date;

import javax.persistence.AttributeOverride;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "avancementTache")
@AttributeOverride(name = "id", column = @Column(name = "avancementTacheId"))
public class TaskHistoryElement extends BaseEntity {

	private static final long serialVersionUID = -7635060765607446274L;

	@Column(name = "ordreAvancement")
	private HistoryState state;

	@Column(name = "commentaire")
	private String comment;

	@Temporal(value = TemporalType.TIMESTAMP)
	@Column(name = "datePassageEtat")
	private Date date;

	@OneToOne
	@JoinColumn(name = "tacheId")
	private Task task;

	/**
	 * @return the state
	 */
	public HistoryState getState() {
		return state;
	}

	/**
	 * @param state
	 *            the state to set
	 */
	public void setState(HistoryState state) {
		this.state = state;
	}

	/**
	 * @return the comment
	 */
	public String getComment() {
		return comment;
	}

	/**
	 * @param comment
	 *            the comment to set
	 */
	public void setComment(String comment) {
		this.comment = comment;
	}

	/**
	 * @return the date
	 */
	public Date getDate() {
		return date;
	}

	/**
	 * @param date
	 *            the date to set
	 */
	public void setDate(Date date) {
		this.date = date;
	}

	/**
	 * @return the task
	 */
	public Task getTask() {
		return task;
	}

	/**
	 * @param task
	 *            the task to set
	 */
	public void setTask(Task task) {
		this.task = task;
	}

}
